using System.Collections.Generic;
using UnityEngine;

public class Ground : MonoBehaviour
{
	public static int shootableLayerMask = -16777216;

	public static int groundTotal = 8;

	public static float groundHeight = 2.5f;

	public GameObject groundColliderPrefab;

	public static List<GameObject> groundColliders = new List<GameObject>();

	private void Awake()
	{
		groundColliders.Clear();
		SetGroundCollider();
	}

	private void SetGroundCollider()
	{
		float num = groundHeight / (float)(groundTotal + 1);
		for (int i = 0; i < groundTotal; i++)
		{
			GameObject gameObject = Object.Instantiate(groundColliderPrefab, base.transform);
			gameObject.transform.position = new Vector2(base.transform.position.x, base.transform.position.y - num * (float)(i + 1));
			gameObject.layer = LayerMask.NameToLayer("Ground" + (i + 1));
			foreach (Transform item in gameObject.transform)
			{
				item.gameObject.layer = gameObject.layer;
			}
			groundColliders.Add(gameObject);
		}
	}
}
